/* USER CODE BEGIN Header */
/**
  ******************************************************************************
  * @file           : main.h
  * @brief          : Header for main.c file.
  *                   This file contains the common defines of the application.
  ******************************************************************************
  * @attention
  *
  * Copyright (c) 2025 STMicroelectronics.
  * All rights reserved.
  *
  * This software is licensed under terms that can be found in the LICENSE file
  * in the root directory of this software component.
  * If no LICENSE file comes with this software, it is provided AS-IS.
  *
  ******************************************************************************
  */
/* USER CODE END Header */

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __MAIN_H
#define __MAIN_H

#ifdef __cplusplus
extern "C" {
#endif

/* Includes ------------------------------------------------------------------*/
#include "stm32h7xx_hal.h"

/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
#include "stdio.h"
#include "stdarg.h"
#include "math.h"
#include "string.h"
#include "stdlib.h"
#include "delay.h"
#include "SDRAM.h"
#include "uart_unpack.h"
/* USER CODE END Includes */

/* Exported types ------------------------------------------------------------*/
/* USER CODE BEGIN ET */
#define LED_TOGGLE(id) (id==0)?HAL_GPIO_TogglePin(LED0_GPIO_Port,LED0_Pin):HAL_GPIO_TogglePin(LED1_GPIO_Port,LED1_Pin)
#define LED(id,x) (id==0)?HAL_GPIO_WritePin(LED0_GPIO_Port,LED0_Pin,(GPIO_PinState)x):HAL_GPIO_WritePin(LED1_GPIO_Port,LED1_Pin,(GPIO_PinState)x)

/* USER CODE END ET */

/* Exported constants --------------------------------------------------------*/
/* USER CODE BEGIN EC */

/* USER CODE END EC */

/* Exported macro ------------------------------------------------------------*/
/* USER CODE BEGIN EM */
extern uint32_t fps_cnt;
/* USER CODE END EM */

/* Exported functions prototypes ---------------------------------------------*/
void Error_Handler(void);

/* USER CODE BEGIN EFP */

/* USER CODE END EFP */

/* Private defines -----------------------------------------------------------*/
#define LED1_Pin GPIO_PIN_0
#define LED1_GPIO_Port GPIOB
#define LED0_Pin GPIO_PIN_1
#define LED0_GPIO_Port GPIOB
#define COUP_MODE_Pin GPIO_PIN_12
#define COUP_MODE_GPIO_Port GPIOB
#define DEC_MODE_Pin GPIO_PIN_13
#define DEC_MODE_GPIO_Port GPIOB
#define DEC_GEAR_Pin GPIO_PIN_14
#define DEC_GEAR_GPIO_Port GPIOB
#define AMP_GEAR2_Pin GPIO_PIN_12
#define AMP_GEAR2_GPIO_Port GPIOD
#define AMP_GEAR1_Pin GPIO_PIN_11
#define AMP_GEAR1_GPIO_Port GPIOC
#define LCD_BLK_Pin GPIO_PIN_5
#define LCD_BLK_GPIO_Port GPIOB

/* USER CODE BEGIN Private defines */

/* USER CODE END Private defines */

#ifdef __cplusplus
}
#endif

#endif /* __MAIN_H */
